void tweet(char *msg)
{
	const char token[] = "1655645984-MQkqgwMwkvDM7ZfW3maaGFwY9xUPo8MvFco34a9";
	uint8_t parseStatus = 0;
	int statusCode = 0;
	
	// Make a HTTP request to Twitter
	Serial.println("Connect to Twitter");
	if (client.connect("arduino-tweet.appspot.com", 80)) {
		Serial.println("Connected.");
		client.println("POST http://arduino-tweet.appspot.com/update HTTP/1.0");
		client.print("Content-Length: ");
		client.println(strlen(msg) + strlen(token) + 14);
		client.println();
		client.print("token=");
		client.print(token);
		client.print("&status=");
		client.print(msg);
		delay(1000);

		// Check status
		if (!client.connected()) {
			while(client.available())
				Serial.print((char)client.read());
			client.flush();
			client.stop();
			Serial.println("Not connected.");
			return;
		} else {
			Serial.println("Client is connected.");
			// Wait for response
			while (!client.available())
				;
			// Now response is available
			char c = client.read();
			Serial.print(c);
			switch(parseStatus) {
				case 0:
				if (c == ' ') parseStatus++; break;  // skip "HTTP/1.1 "
				case 1:
				if (c >= '0' && c <= '9') {
					statusCode *= 10;
					statusCode += c - '0';
				} else {
					parseStatus++;
				}
			}
			Serial.print("Status: ");
			Serial.println(statusCode);	
		}
		// Client no longer needs to be connected
		client.stop();
		Serial.println("Connection to client is now stopped.");
	} else {
		Serial.println("Connection to Twitter failed.");
	}
}